<?php
namespace app\admin\controller;

use cmf\controller\AdminBaseController;
use think\Validate;
use think\Db;
use app\admin\model\DoctorModel;
class PatientController extends AdminBaseController
{
     public function index()
     {
          return $this->fetch();
     }
     public function list()
     {
          $levelinfo=Db::name('patient_list')->select()->toArray();
          return $this->fetch('Patient/list',[
                'listinfo'=>$levelinfo
            ]);
     }
     //患者筛选
     public function screen()
    {
        $data = $this->request->param();
        if($data['keyword'] != "")
        {
            $map['nickname'] = array('like', '%' . $data['keyword'] . '%');
            $listinfo=Db::name('patient_list')->where($map)->select()->toArray();
        }else if($data['category'] !=""){
            $listinfo=Db::name('patient_list')->where('status',$data['category'])->select()->toArray();
        }else{
             $listinfo=Db::name('patient_list')->select()->toArray();
        }
        return $this->fetch('Patient/list',[
            'listinfo'=>$listinfo
        ]);

    }
}
